
import { createRouter, createWebHistory } from 'vue-router'

let routes = [
    {
        path: '/home',
        name: 'home',
        component: () => import('@/views/Home.vue'),
        meta: { title: '首页', icon:'House',show: true ,useFrame: false}
    },
    {
        path: '/',
        name: 'moveshow',
        component: () => import('@/views/MoveShow.vue'),
        meta: { title: '移动端首页', icon: 'home-filled', show: false, useFrame: true }
    },
    {
        path: '/productlist',
        name: 'productlist',
        component: () => import('@/views/MoveProductList.vue'),
        meta: { title: '商品详情页', icon: 'shop-o', show: false, useFrame: true }
    },
    {
        path: '/movecategory',
        name: 'movecategory',
        component: () => import('@/views/moveCategory/MoveCategory.vue'),
        meta: { title: '移动端商品分类', icon: 'shop-o', show: false, useFrame: true }
    },
    {
        path: '/products',
        name: 'products',
        component: () => import('@/views/moveProduct/MoveProducts.vue'),
        meta: { title: '移动端商品列表', icon: 'shop-o', show: false, useFrame: true }
    },
    {
        path:'/product',
        component: () => import('@/views/Product/Index.vue'),
        meta: { title: '商品管理', icon: 'Handbag', show: true },
        children: [
            {
                path: '/product/add',
                name: 'product-add',
                component:()=>import('@/views/Product/Add.vue'),
                meta: { title: '添加商品', icon:'Plus', show: true }
            },
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import('@/views/Product/List.vue'),
                meta: { title: '商品列表', icon: 'List', show: true }
            },
            {
                path: '/product/edit',
                name: 'product-edit',
                component: () => import('@/views/Product/Edit.vue'),
                meta: { title: '商品修改', icon: 'Edit', show: true }
            }
        ]
    }
    ,
    {
        path: '/category',
        component: () => import('@/views/Category/Index.vue'),
        meta: { title: '类目管理', icon: 'List', show: true },
        children: [
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import('@/views/Category/Add.vue'),
                meta: { title: '添加分类', icon: 'Plus', show: true }
            },
            {
                path: '/category/list',
                name: 'category-list',
                component: () => import('@/views/Category/List.vue'),
                meta: { title: '类目列表', icon: 'List', show: true }
            },
            {
                path: '/category/edit',
                name: 'category-edit',
                component: () => import('@/views/Category/Edit.vue'),
                meta: { title: '修改分类', icon: 'Edit', show: true }
            }
        ]
    }
            
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router